The current Blackfin nand write function fills up the write buffer but
returns before it has had a chance to drain. On faster systems, this
isn't a problem as the operation finishes before the ECC registers are
read, but on slower systems the ECC may be incomplete when the core tries
to read it.
So wait for the buffer to drain once we're done writing to it.
Signed-off-by: Andrew Caldwell <[email protected]>
Signed-off-by: Mike Frysinger <[email protected]>
int bfin_nfc_devready(struct mtd_info *mtd)
{
pr_stamp();
- return (bfin_read_NFC_STAT() & NBUSY ? 1 : 0);
+ return (bfin_read_NFC_STAT() & NBUSY) ? 1 : 0;
}
/*
bfin_write_NFC_DATA_WR(buf[i]);
}
+
+ /* Wait for the buffer to drain before we return */
+ while (!(bfin_read_NFC_STAT() & WB_EMPTY))
+ if (ctrlc())
+ return;
}
/*